from django.urls import path

from .views import SpitView, CommentView, HandelCollectedHasthumbupView


urlpatterns = [

    # 获取吐槽列表、新增吐槽or评论
    path('spit/', SpitView.as_view({
        'get': 'my_list',
        'post': 'new_spit_comment'
    })),

    # 获取吐槽详情
    path('spit/<int:pk>/', SpitView.as_view({
        'get': 'my_retrieve',
    })),

    # 收藏or取消收藏
    path('spit/<int:pk>/collect/', HandelCollectedHasthumbupView.as_view()),

    # 点赞or取消点赞
    path('spit/<int:pk>/updatethumbup/', HandelCollectedHasthumbupView.as_view()),

    path('spit/<int:pk>/children/', CommentView.as_view({
        'get': 'my_list'
    }))
]
